import Talk from '../controller/talk';
import Login from '../controller/login';
import MakeClientMsgPackage from '../controller/makeTemporaryTalk'
import Heartbeat from '../controller/heartbeat';
import RefreshInEditSelfInfo from '../controller/refreshInEditSelfInfo';
import GetTalkDetail from '../controller/getTalkDetail';
import AddFriendUseTalkId from '../controller/addFriendUseMemberId';
import AddFriendUseMemberId from '../controller/addFriendUseMemberId';
import DelFriend from "../controller/delFriend";
import GetSelfTalkList from "../controller/getSelfTalkList";
import FindFriendFromTel from "../controller/findFriendFromTel";
import ExamineToFriend from '../controller/examineToFriend';
const messageObject = {                                                 //消息类型集合
    talk: Talk,
    login: Login,
    makeTemporaryTalk: MakeClientMsgPackage,
    heartbeat: Heartbeat,
    getTalkDetail: GetTalkDetail,
    refreshInEditSelfInfo: RefreshInEditSelfInfo,
    addFriendUseTalkId: AddFriendUseTalkId,
    addFriendUseMemberId: AddFriendUseMemberId,
    delFriend: DelFriend,
    getSelfTalkList: GetSelfTalkList,
    findFriendFromTel: FindFriendFromTel,
    examineToFriend:ExamineToFriend
}
export default class MessageObject {
    static instance = null;
    constructor(socket) {
        if (!MessageObject.instance) {
            MessageObject.instance = this;
            this.messageObject = {};
            const keys = Object.keys(messageObject);
            keys.forEach(item => {this[item] = new messageObject[item](socket)})
        }
        return MessageObject.instance
    }
}


